package com.ng.finance.api.controller;


import com.baomidou.mybatisplus.plugins.Page;
import com.ng.finance.api.service.BxVoucherService;
import com.ng.finance.common.pojo.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 83673
 * @since 2018-11-05
 */
@RestController
@RequestMapping("/api/bxVoucher")
public class BxVoucherController {

    @Resource
    BxVoucherService bxVoucherService;

    /**
     * 查询生成报销单
     */
    @GetMapping(value = "selectBxVoucher")
    public Result selectBxVoucher(@NotNull @RequestParam Long id) {
        return bxVoucherService.selectBxVoucher(id);
    }


    /**
     * 去报销
     */
    @PostMapping(value = "goBx")
    public Result goBx(@NotNull @RequestParam Long id, @NotNull @RequestParam String bxPic) {
        return bxVoucherService.goBx(id, bxPic);
    }


    /**
     * 查询报销记录
     */
    @GetMapping(value = "selectBxVoucherList")
    public Result selectBxVoucherList(Integer bxTag, Long userId, Page page) {
        return bxVoucherService.selectBxVoucherList(bxTag, userId, page);
    }


}

